package org.jeecg.modules.imm.api.factory;

import feign.hystrix.FallbackFactory;
import org.jeecg.modules.imm.api.ImmBaseCloudApi;
import org.jeecg.modules.imm.api.fallback.ImmBaseCloudApiFallback;
import org.springframework.stereotype.Component;

/**
 * @Author: zzq
 */
@Component
public class ImmBaseCloudApiFallbackFactory implements FallbackFactory<ImmBaseCloudApi> {
    @Override
    public ImmBaseCloudApi create(Throwable throwable) {
        ImmBaseCloudApiFallback immBaseCloudApiFallback = new ImmBaseCloudApiFallback();
        immBaseCloudApiFallback.setCause(throwable);
        return immBaseCloudApiFallback;
    }
}
